class Random {
  random() {
    return Math.random();
  }

  randomWord(len = 10, keys) {
    let str = '',
      l = keys.length;
    while (len > 0) {
      const _in = this.randomRangeInt(0, l - 1);
      str += keys[_in];
      len--;
    }
    return str;
  }

  randomRangeInt(min = 0, max) {
    const num = Number.parseInt(this.random() * (max - min + 1) + min);
    return num;
  }

}


module.exports = new Random();